/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.reporte.modelo;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author luisrg
 */
@Embeddable
public class ParametroReportePK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 60)
    @Column(name = "NOMBRE", nullable = false, length = 60)
    private String nombre;
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID_REPORTE", nullable = false)
    private long idReporte;

    public ParametroReportePK() {
    }

    public ParametroReportePK(String nombre, long idReporte) {
        this.nombre = nombre;
        this.idReporte = idReporte;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public long getIdReporte() {
        return idReporte;
    }

    public void setIdReporte(long idReporte) {
        this.idReporte = idReporte;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (nombre != null ? nombre.hashCode() : 0);
        hash += (int) idReporte;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ParametroReportePK)) {
            return false;
        }
        ParametroReportePK other = (ParametroReportePK) object;
        if ((this.nombre == null && other.nombre != null) || (this.nombre != null && !this.nombre.equals(other.nombre))) {
            return false;
        }
        if (this.idReporte != other.idReporte) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.reporte.modelo.ParametroReportePK[ nombre=" + nombre + ", idReporte=" + idReporte + " ]";
    }
    
}
